package com.kb.vo.components;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.time.LocalDateTime;
import java.util.List;

@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "组件价格")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ComponentPriceVO {
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "最后更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "创建者，目前使用 SysUser 的 id 编号", notes = "使用 String 类型的原因是，未来可能会存在非数值的情况，留好拓展性")
    private String creator;

    @ApiModelProperty(value = "更新者，目前使用 SysUser 的 id 编号", notes = "使用 String 类型的原因是，未来可能会存在非数值的情况，留好拓展性")
    private String updater;

    @ApiModelProperty(value = "编号")
    private Long id;

    @ApiModelProperty(value = "库存编号")
    private Long stockId;

    @ApiModelProperty(value = "折扣价JSON")
    private String json;

    @ApiModelProperty(value = "库存数量")
    private Long stock;

    @ApiModelProperty(value = "包装")
    private String packaging;

    @ApiModelProperty(value = "封装")
    private String encapsulation;

    @ApiModelProperty(value = "型号")
    private String model;

    @ApiModelProperty(value = "货币")
    private String currency;

    @ApiModelProperty(value = "成本价Json")
    private String costJson;

    @ApiModelProperty(value = "销售价Json")
    private String saleJson;

    @ApiModelProperty(value = "有效期，单位：分钟", example = "180")
    private Long validateTime = 180L;

    @ApiModelProperty(value = "单位")
    private String unit;

    @ApiModelProperty(value = "类型", allowableValues = "2", notes = "2-手动维护，需要定时清除")
    private Integer type;

    @ApiModelProperty(value = "子价格列表")
    private List<ComponentPriceVO> children;

    @ApiModelProperty(value = "库存基本信息")
    @TableField(exist = false)
    private ComponentStockVO stockInfo;

    @ApiModelProperty(value = "成本价格文本")
    @TableField(exist = false)
    private String costPriceText;

    @ApiModelProperty(value = "销售价格文本")
    @TableField(exist = false)
    private String priceText;

    @ApiModelProperty(value = "数量文本")
    @TableField(exist = false)
    private String numText;

    @ApiModelProperty(value = "匹配销售价")
    @TableField(exist = false)
    private String matchPrice;

    @ApiModelProperty(value = "匹配成本价")
    @TableField(exist = false)
    private String matchCostPrice;

    @ApiModelProperty(value = "查询数量")
    private Integer qty;

    @ApiModelProperty(value = "匹配数量")
    private Integer matchingQuantity;

    @ApiModelProperty(value = "匹配折扣率")
    private String matchDiscount;


}